[Javascript] JavaScript Prompt Box

Håkan Magnusson hakan at backbase.com
Fri Apr 16 12:00:37 CDT 2004


Just to add a suggestion,

you can create another div as well, with position 0,0 and width/height 
100%, z-index one below your PromptBox, to simulate the "modal" 
behaviour of normal alert boxes. When your promptbox shows up, simply 
show the (empty but covering the entire page) div behind it, preventing 
any link clicking until the user has reacted on your promptbox.

I don't know if I'm being very clear, but hey, it's 19.00hrs here, and 
I'm half way to the bar. Hope this helps anyway.

Regards,
H

Paul Novitski wrote:

> Mark,
> 
> It sounds like you probably want to 'roll your own' prompt box instead 
> of using the built-in javascript prompt function.  Something like:
> 
> <div id="PromptBox" style="position: absolute;  visibility: hidden;">
> 
>         <div id="PromptBoxHead">How many copies?</div>
> 
>         <input id="PromptBoxInput" type=text />
> 
>         <button onClick="jsProcessPromptBox('true')">OK</button>
>         <button onClick="jsProcessPromptBox('false')">CANCEL</button>
> </div>
> 
> <select onChange="jsRevealPromptBox(options[selectedIndex].value)">
>         <option></option>
>         <option value="winnt">Windows NT</option>
>         <option value="win2k">Windows 2000</option>
>         <option value="winxp">Windows XP</option>
> </select>
> 
> To reveal the prompt box, position it wherever you want on the screen 
> and toggle its visibility.  Or fix its x/y coordinates in CSS with 
> #PromptBox{}, where you can also set its colors, borders, etc.
> 
> The other alternative is to create a child window with window.open().
> 
> Paul
> 
> 
> At 09:29 AM 4/16/2004, mark wrote:
> 
>> Thanks very much. That's the general idea but I want to see if it's
>> possible to control the behaviour of this prompt, i.e. where it 
>> appears on
>> page, etc.
>> Mark.
> 
> 
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 



More information about the Javascript mailing list